
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom'
import pages from './pages/index'
function App() {
  return (
    <BrowserRouter>
        <Switch>
        <Route path='/' exact>
          <Redirect to='/admin'></Redirect>
        </Route>
          {
            Object.keys(pages).map(key => (
              <Route key={key} path={ `/${key.toLowerCase()}` } component= {pages[key]}></Route>
            ))
          }
          <Route path="*" component={ pages.page404 } />
        </Switch>
    </BrowserRouter>
  );
}

export default App;
